Magnetic sensors in combination with permanent magnets or magnetized components can be used to sense the position and speed of mechanical components. For example, if a magnetic sensor is placed at close distance from a magnetized wheel, whose circumference is divided into sections alternatively magnetized as magnetic south and north, the magnetic sensor will sense a periodic changing magnetic field as the wheel rotates. By analyzing the output of the sensor and knowing the mechanical construction of the wheel, it is possible to determine, for example, the frequency of the time varying magnetic field at the sensor location and, consequently, the angular speed of the wheel.
In some applications, only specific positions of the mechanical part need to be detected. This translates in the detection of the instants at which the output of the magnetic sensor has particular values. For example, in many practical cases, it is interesting to identify the instants of the zero-crossing of the magnetic field.
Any error in the sensor or in its readout, such as any offset superimposed to the signal, will cause an error in the determination of the zero crossings. In many magnetic sensors, such as Anisotropic Magnetic Resistance (AMR) sensors, offset can be even larger than the signal amplitude, resulting in unacceptable errors or even in no detection. Moreover, if any offset is present in the magnetic domain, such as any DC stray field parallel to the field to be sensed, many conventional techniques for offset cancellation do not work properly.
Offset could be extrapolated by observing the sensor output signal for a limited amount of time and fitting it with the expected signal. However, this is unpractical if the signal is observed for less than one period and requires the knowledge of some characteristics of the signal (the shape, the amplitude, the frequency) which are not always available during normal working. On the contrary, the offset can be obtained by averaging one period of the sensor output signal and without any prior knowledge about the signal properties. However, in some applications it is not allowed to wait for a full period of the output signal before generating the first accurate zero-crossing signal. In those cases, sub-Hz magnetic fields are observed and waiting for a full period of the signal would result in a too large latency.
Currently, a common solution to those problems is calibration of the offset during testing. This can be done by laser trimming of the sensor or by measuring the offset during testing and using feed-forward compensation during normal operation. As a drawback, those techniques increase the testing costs and may bring to inaccurate results due to offset variations because of temperature or ageing.
US 2010/0194387 A1 discloses a magnetoresistive sensor system, wherein the system comprises a magnetic field source, a magnetoresistive sensor having an easy axis, and a differentiation element. The magnetic field source is adapted to emit an auxiliary magnetic field generated from an oscillating input signal. The auxiliary magnetic field is orthogonal to the easy axis of the magnetoresistive sensor. The magnetoresistive sensor is adapted to sense a signal associated to a superposition of an external magnetic field and the auxiliary alternating magnetic field, wherein the differentiation element is adapted to differentiate the sensed signal.